The MPEG-2 transport stream is specifically designed for transmission in conditions that can generate data errors. MPEG transport packets each have a fixed length. Many programs, each with different components, may be combined in a transport stream. Examples of services that can be provided using the MPEG format are television services broadcast over terrestrial, cable television and satellite networks as well as interactive telephony-based services.
Commonly, transport streams carrying encoded digital video data are transmitted over packet-based networks, such as an Ethernet network. For example, each Ethernet frame may carry multiple transport stream packets. Due, for example, to variable transmission delays experienced by the Ethernet frames, individual transport stream packets suffer from variable delays at the receiving equipment, referred to as “jitter.” Jitter deleteriously affects the processing and decoding of video data carried by the transport stream packets. As such, the receiving equipment must compensate for the jitter before distributing the transport stream packets.
In a digital video compression system, such as the MPEG-2 system, the digital video source is clocked at 27 MHz. The decoder (receiver) must generate the same 27 MHz clock such that the encoder and decoder clocks are synchronized. This clock is referred to as the system time clock (STC). The encoder and decoder each have a counter that is incremented on each tick of the STC. When the encoder and decoder STCs are synchronized, both counters are the same value.
The MPEG standard provides mechanisms for a receiver to synchronize its internal system time clock to that of the stream transmitter. This synchronization is necessary, for example, in order to avoid data loss due to buffer underruns or overflows in the receiver and consequently, noticeable artifacts in reproduced video content.
To synchronize with the decoder, the encoder sends a program clock reference (PCR) to the decoder. The PCR is a count which reflects the value of the encoder's STC for the associated program at the time the PCR bytes were inserted into the transport stream. Both PCR and STC are 42 bit counters composed by a base 33 bit counter that grows monotonically at 90 KHz and a 9 bit extension that grows monotonically at 27 MHz. When the packet with the PCR is received by the decoder, the decoder compares the 33 bit clock base of the PCR value with the 33 bit clock base of the decoder's STC counter value. If the two are the same, no adjustment is needed. If the two values are different, the decoder must either reset, speed up, or slow down its STC.
More specifically, an MPEG decoder uses the PCR to synchronize a decoder time clock with the encoder system clock. The lower nine bits of the 42-bit PCR provide a modulo-300 counter that is incremented at a 27 MHz clock rate (the “system clock rate”). At each modulo-300 rollover, the count in the upper 33 bits is incremented, such that the upper bits represent counts that occur at a 90 kHz rate. Since each program or service carried by the data stream may have its own PCR, the programs and services can be multiplexed asynchronously.